Basic 3D Data Types

The following 3D data types are defined using the basic data types described in the previous section.

Two-Dimensional Points

typedef struct Point2D {
 Float32        x;
 Float32        y;
} Point2D;
typedef struct DPoint2D {
 Float64        x;
 Float64        y;
} DPoint2D;

Three-Dimensional Points

typedef struct Point3D {
 Float32        x;
 Float32        y;
 Float32        z;
} Point3D;
typedef struct DPoint3D {
 Float64        x;
 Float64        y;
 Float64        z;
} DPoint3D;

Three-Dimensional Rational Points

typedef struct RationalPoint3D {
 Float32        x;
 Float32        y;
 Float32        w;
} RationalPoint3D;
typedef struct DRationalPoint3D {
 Float64        x;
 Float64        y;
 Float64        w;
} DRationalPoint3D;

Four-Dimensional Rational Points

typedef struct RationalPoint4D {
 Float32        x;
 Float32        y;
 Float32        z;
 Float32        w;
} RationalPoint4D;
typedef struct DRationalPoint4D {
 Float64        x;
 Float64        y;
 Float64        z;
 Float64        w;
} DRationalPoint4D;
Note
Three- and four-dimensional points are used to represent two- and three-dimensional points respectively in homogeneous coordinate systems. ·

Color Data Types

typedef struct RGBColor {
 Float32        red;
 Float32        green;
 Float32        blue;
} RGBColor;
IMPORTANT
The values in the fields of an RGB color data type must lie in the closed interval [0, 1]. 0 is the minimum value; 1 is the maximum value. ·
The 3D metafile currently supports only the RGB (red, green blue) color model.

Two-Dimensional Vectors

typedef struct Vector2D {
 Float32        x;
 Float32        y;
} Vector2D;
typedef struct DVector2D {
 Float64        x;
 Float64        y;
} DVector2D;

Three-Dimensional Vectors

typedef struct Vector3D {
 Float32        x;
 Float32        y;
 Float32        z;
} Vector3D;
typedef struct DVector3D {
 Float64        x;
 Float64        y;
 Float64        z;
} DVector3D;

Parameterizations

typedef struct Param2D {
 Float32    u;
 Float32    v;
} Param2D;
typedef struct Param3D {
 Float32    u;
 Float32    v;
 Float32    w;
} Param3D;
typedef struct DParam2D {
 Float64    u;
 Float64    v;
} DParam2D;
typedef struct DParam3D {
 Float64    u;
 Float64    v;
 Float64    w;
} DParam3D;

Tangents

typedef struct Tangent2D {
 Vector3D        uTangent;
 Vector3D        vTangent;
} Tangent2D;
typedef struct Tangent3D {
 Vector3D        uTangent;
 Vector3D        vTangent;
 Vector3D        wTangent;
} Tangent3D;
typedef struct DTangent2D {
 DVector3D        uTangent;
 DVector3D        vTangent;
} DTangent2D;
typedef struct DTangent3D {
 DVector3D        uTangent;
 DVector3D        vTangent;
 DVector3D        wTangent;
} DTangent3D;

Matrices

typedef Float32 Matrix3x3          [3][3];
typedef Float32 Matrix4x4          [4][4];
typedef Float64 DMatrix3x3          [3][3];
typedef Float64 DMatrix4x4          [4][4];

3D Metafile Reference
© Apple Computer, Inc.